# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Maintainer: Dmitry Zakharchenko <dmitz@disroot.org>
pkgname=py3-grequests
_pkgname=grequests
pkgver=0.7.0
pkgrel=2
pkgdesc="Asynchronus HTTP requests with gevent"
url="https://github.com/spyoungtech/grequests"
arch="noarch"
license="BSD-2-Clause"
depends="python3 py3-gevent py3-requests"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-nose"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/spyoungtech/grequests/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check" # need net to httpbin and timeout quickly

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m nose
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ff3e57c7ed8ea643ad0b7a1987216e98de77d650807037a3c953f8fdb8e9a0090d79debb54205a13934c10043e4d3693336b9d9c1b5342fef383221bfefd5330  grequests-0.7.0.tar.gz
"
